package com.czkt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czkt.entity.CstLost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Mapper
public interface CstLostMapper extends BaseMapper<CstLost> {
    @Select("select * from cst_lost where lst_cust_name like concat('%',#{lstCustName},'%')  and lst_cust_manager_name like concat('%',#{lstCustManagerName},'%')")
    IPage<CstLost> selectCstLost(IPage<CstLost> cstLostIPage,@Param("lstCustName")String lstCustName, @Param("lstCustManagerName") String lstCustManagerName);

    @Select("select * from cst_lost where lst_id = #{lostId};")
    CstLost selectCstLostUpdate(String lstId);
    
    @Select("update cst_lost set lst_cust_name = #{lstCustName},lst_cust_manager_name=#{lstCustManagerName},lst_last_order_date=#{lstLastOrderDate},lst_lost_date=#{lstLostDate},lst_reason=#{lstReason} where lst_id=#{lstId};")
    void toUpdateCstLost(CstLost cstLost);
}